{% extends "base.html" %}

{% block title %}联系我们 - SteHub{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-lg-8">
        <div class="card">
            <div class="card-header">
                <h2 class="mb-0"><i class="fas fa-envelope me-2"></i>联系我们</h2>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <h4>📞 联系信息</h4>
                        <div class="contact-info">
                            <div class="d-flex align-items-center mb-3">
                                <i class="fas fa-envelope fa-lg text-primary me-3"></i>
                                <div>
                                    <h6 class="mb-0">邮箱支持</h6>
                                    <p class="text-muted mb-0">support@stehub.com</p>
                                </div>
                            </div>
                            
                            <div class="d-flex align-items-center mb-3">
                                <i class="fas fa-comments fa-lg text-primary me-3"></i>
                                <div>
                                    <h6 class="mb-0">社区论坛</h6>
                                    <p class="text-muted mb-0">在论坛发帖获得帮助</p>
                                </div>
                            </div>
                            
                            <div class="d-flex align-items-center mb-3">
                                <i class="fas fa-bug fa-lg text-primary me-3"></i>
                                <div>
                                    <h6 class="mb-0">问题反馈</h6>
                                    <p class="text-muted mb-0">通过GitHub提交问题</p>
                                </div>
                            </div>
                        </div>

                        <h5 class="mt-4">⏰ 响应时间</h5>
                        <ul class="list-unstyled">
                            <li><i class="fas fa-check text-success me-2"></i>一般问题：24小时内</li>
                            <li><i class="fas fa-check text-success me-2"></i>紧急问题：12小时内</li>
                            <li><i class="fas fa-check text-success me-2"></i>技术问题：48小时内</li>
                        </ul>
                    </div>

                    <div class="col-md-6">
                        <h4>💬 发送消息</h4>
                        <form id="contactForm">
                            <div class="mb-3">
                                <label for="name" class="form-label">姓名</label>
                                <input type="text" class="form-control" id="name" required>
                            </div>
                            
                            <div class="mb-3">
                                <label for="email" class="form-label">邮箱</label>
                                <input type="email" class="form-control" id="email" required>
                            </div>
                            
                            <div class="mb-3">
                                <label for="subject" class="form-label">主题</label>
                                <select class="form-select" id="subject" required>
                                    <option value="">请选择问题类型</option>
                                    <option value="bug">Bug报告</option>
                                    <option value="feature">功能建议</option>
                                    <option value="help">使用帮助</option>
                                    <option value="other">其他问题</option>
                                </select>
                            </div>
                            
                            <div class="mb-3">
                                <label for="message" class="form-label">详细描述</label>
                                <textarea class="form-control" id="message" rows="5" required 
                                          placeholder="请详细描述您的问题或建议..."></textarea>
                            </div>
                            
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-paper-plane me-2"></i>发送消息
                            </button>
                        </form>
                    </div>
                </div>

                <!-- 常见问题链接 -->
                <div class="alert alert-info mt-4">
                    <h6><i class="fas fa-lightbulb me-2"></i>温馨提示</h6>
                    <p class="mb-2">在联系我们之前，建议先查看：</p>
                    <ul class="mb-0">
                        <li><a href="{{ url_for('main.help') }}" class="alert-link">使用帮助文档</a></li>
                        <li><a href="#" class="alert-link">常见问题解答</a></li>
                        <li><a href="#" class="alert-link">社区论坛</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block extra_js %}
<script>
document.addEventListener('DOMContentLoaded', function() {
    const contactForm = document.getElementById('contactForm');
    
    contactForm.addEventListener('submit', function(e) {
        e.preventDefault();
        
        // 这里可以添加表单提交逻辑
        const formData = {
            name: document.getElementById('name').value,
            email: document.getElementById('email').value,
            subject: document.getElementById('subject').value,
            message: document.getElementById('message').value
        };
        
        // 模拟提交成功
        alert('感谢您的反馈！我们会尽快回复您。');
        contactForm.reset();
    });
});
</script>
{% endblock %}